package b.g.b;

import java.util.ArrayList;

/* compiled from: ArrayRow */
public class b implements b.g.b.d.a {
    public g a = null;
    public float b = 0.0f;
    public ArrayList<g> c = new ArrayList();
    public a d;
    public boolean e = false;

    /* compiled from: ArrayRow */
    public interface a {
        float a(int i);

        void b(g gVar, float f, boolean z);

        float c(g gVar);

        void clear();

        boolean d(g gVar);

        int e();

        float f(b bVar, boolean z);

        void g(g gVar, float f);

        float h(g gVar, boolean z);

        g i(int i);

        void j(float f);

        void k();
    }

    public void a(g gVar) {
        float f;
        int i = gVar.d;
        if (i != 1) {
            if (i == 2) {
                f = 1000.0f;
            } else if (i == 3) {
                f = 1000000.0f;
            } else if (i == 4) {
                f = 1.0E9f;
            } else if (i == 5) {
                f = 1.0E12f;
            }
            this.d.g(gVar, f);
        }
        f = 1.0f;
        this.d.g(gVar, f);
    }

    public g b(d dVar, boolean[] zArr) {
        return i(zArr, null);
    }

    public b c(d dVar, int i) {
        this.d.g(dVar.k(i, "ep"), 1.0f);
        this.d.g(dVar.k(i, "em"), -1.0f);
        return this;
    }

    public void clear() {
        this.d.clear();
        this.a = null;
        this.b = 0.0f;
    }

    public b d(g gVar, g gVar2, g gVar3, g gVar4, float f) {
        this.d.g(gVar, -1.0f);
        this.d.g(gVar2, 1.0f);
        this.d.g(gVar3, f);
        this.d.g(gVar4, -f);
        return this;
    }

    public b e(g gVar, g gVar2, g gVar3, int i) {
        Object obj = null;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                obj = 1;
            }
            this.b = (float) i;
        }
        if (obj == null) {
            this.d.g(gVar, -1.0f);
            this.d.g(gVar2, 1.0f);
            this.d.g(gVar3, 1.0f);
        } else {
            this.d.g(gVar, 1.0f);
            this.d.g(gVar2, -1.0f);
            this.d.g(gVar3, -1.0f);
        }
        return this;
    }

    public b f(g gVar, g gVar2, g gVar3, int i) {
        Object obj = null;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                obj = 1;
            }
            this.b = (float) i;
        }
        if (obj == null) {
            this.d.g(gVar, -1.0f);
            this.d.g(gVar2, 1.0f);
            this.d.g(gVar3, -1.0f);
        } else {
            this.d.g(gVar, 1.0f);
            this.d.g(gVar2, -1.0f);
            this.d.g(gVar3, 1.0f);
        }
        return this;
    }

    public b g(g gVar, g gVar2, g gVar3, g gVar4, float f) {
        this.d.g(gVar3, 0.5f);
        this.d.g(gVar4, 0.5f);
        this.d.g(gVar, -0.5f);
        this.d.g(gVar2, -0.5f);
        this.b = -f;
        return this;
    }

    public final boolean h(g gVar) {
        return gVar.l <= 1;
    }

    public final g i(boolean[] zArr, g gVar) {
        int e = this.d.e();
        g gVar2 = null;
        float f = 0.0f;
        for (int i = 0; i < e; i++) {
            float a = this.d.a(i);
            if (a < 0.0f) {
                g i2 = this.d.i(i);
                if ((zArr == null || !zArr[i2.b]) && i2 != gVar) {
                    b.g.b.g.a aVar = i2.i;
                    if ((aVar == b.g.b.g.a.SLACK || aVar == b.g.b.g.a.ERROR) && a < f) {
                        f = a;
                        gVar2 = i2;
                    }
                }
            }
        }
        return gVar2;
    }

    public boolean isEmpty() {
        return this.a == null && this.b == 0.0f && this.d.e() == 0;
    }

    public void j(g gVar) {
        g gVar2 = this.a;
        if (gVar2 != null) {
            this.d.g(gVar2, -1.0f);
            this.a.c = -1;
            this.a = null;
        }
        float h = this.d.h(gVar, true) * -1.0f;
        this.a = gVar;
        if (h != 1.0f) {
            this.b /= h;
            this.d.j(h);
        }
    }

    public void k(d dVar, g gVar, boolean z) {
        if (gVar.f) {
            float c = this.d.c(gVar);
            this.b = (gVar.e * c) + this.b;
            this.d.h(gVar, z);
            if (z) {
                gVar.b(this);
            }
            if (this.d.e() == 0) {
                this.e = true;
                dVar.a = true;
            }
        }
    }

    public void l(d dVar, b bVar, boolean z) {
        float f = this.d.f(bVar, z);
        this.b = (bVar.b * f) + this.b;
        if (z) {
            bVar.a.b(this);
        }
        if (this.a != null && this.d.e() == 0) {
            this.e = true;
            dVar.a = true;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:26:0x007f  */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x007a  */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x007a  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x007f  */
    public java.lang.String toString() {
        /*
        r9 = this;
        r0 = r9.a;
        if (r0 != 0) goto L_0x0007;
    L_0x0004:
        r0 = "0";
        goto L_0x0016;
    L_0x0007:
        r0 = "";
        r0 = c.b.a.a.a.g(r0);
        r1 = r9.a;
        r0.append(r1);
        r0 = r0.toString();
    L_0x0016:
        r1 = " = ";
        r0 = c.b.a.a.a.D(r0, r1);
        r1 = r9.b;
        r2 = 0;
        r3 = 0;
        r1 = (r1 > r2 ? 1 : (r1 == r2 ? 0 : -1));
        if (r1 == 0) goto L_0x0033;
    L_0x0024:
        r0 = c.b.a.a.a.g(r0);
        r1 = r9.b;
        r0.append(r1);
        r0 = r0.toString();
        r1 = 1;
        goto L_0x0034;
    L_0x0033:
        r1 = 0;
    L_0x0034:
        r4 = r9.d;
        r4 = r4.e();
    L_0x003a:
        if (r3 >= r4) goto L_0x009a;
    L_0x003c:
        r5 = r9.d;
        r5 = r5.i(r3);
        if (r5 != 0) goto L_0x0045;
    L_0x0044:
        goto L_0x0097;
    L_0x0045:
        r6 = r9.d;
        r6 = r6.a(r3);
        r7 = (r6 > r2 ? 1 : (r6 == r2 ? 0 : -1));
        if (r7 != 0) goto L_0x0050;
    L_0x004f:
        goto L_0x0097;
    L_0x0050:
        r5 = r5.toString();
        r8 = -1082130432; // 0xffffffffbf800000 float:-1.0 double:NaN;
        if (r1 != 0) goto L_0x0063;
    L_0x0058:
        r1 = (r6 > r2 ? 1 : (r6 == r2 ? 0 : -1));
        if (r1 >= 0) goto L_0x0074;
    L_0x005c:
        r1 = "- ";
        r0 = c.b.a.a.a.D(r0, r1);
        goto L_0x0072;
    L_0x0063:
        if (r7 <= 0) goto L_0x006c;
    L_0x0065:
        r1 = " + ";
        r0 = c.b.a.a.a.D(r0, r1);
        goto L_0x0074;
    L_0x006c:
        r1 = " - ";
        r0 = c.b.a.a.a.D(r0, r1);
    L_0x0072:
        r6 = r6 * r8;
    L_0x0074:
        r1 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        r1 = (r6 > r1 ? 1 : (r6 == r1 ? 0 : -1));
        if (r1 != 0) goto L_0x007f;
    L_0x007a:
        r0 = c.b.a.a.a.D(r0, r5);
        goto L_0x0096;
    L_0x007f:
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r1.append(r0);
        r1.append(r6);
        r0 = " ";
        r1.append(r0);
        r1.append(r5);
        r0 = r1.toString();
    L_0x0096:
        r1 = 1;
    L_0x0097:
        r3 = r3 + 1;
        goto L_0x003a;
    L_0x009a:
        if (r1 != 0) goto L_0x00a2;
    L_0x009c:
        r1 = "0.0";
        r0 = c.b.a.a.a.D(r0, r1);
    L_0x00a2:
        return r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.g.b.b.toString():java.lang.String");
    }

    public b(c cVar) {
        this.d = new a(this, cVar);
    }
}
